***replication do file for David-Barrett-Fazekas (2019) Anti-corruption in aid-funded procurement: Is corruption reduced or merely displaced? World Development
***18/10/2019
*************************************************************************


***opening dataset (please replace the path with your folder)

use "d:\[your folder pathway]\DavidBarrett-FazekasCorruptionDisplacement_replicaton.dta"



***main text***


*** Table 1

tab year ba_wb2003g_25 if divwb2003g>=0 & divwb2003g!=. & ba_wb2003g_25!=.


*** Table 3 

tab cft_sector, gen(cft_sector)
tab qcountry_iso3, gen(qcountry_iso3)
tab year, gen(year)

psmatch2 ba_wb2003g_25 anb_corr_proc32_bwb2003g c_corr_proc32_bwb2003g lca_contract_value cft_sector2-cft_sector11 year9-year18 if divwb2003g>=0, out(corr_proc32) common logit noreplacement
psmatch2 ba_wb2003g_25 anb_sb_bwb2003g c_sb_bwb2003g lca_contract_value cft_sector2-cft_sector11 year9-year18 if divwb2003g>=0, out(singleb) common logit noreplacement
psmatch2 ba_wb2003g_25 anb_ca_bids_bwb2003g c_ca_bids_bwb2003g lca_contract_value cft_sector2-cft_sector11 year9-year18 if divwb2003g>=0, out(ca_bids) common logit noreplacement
psmatch2 ba_wb2003g_25 anb_w_repeat_bwb2003g c_w_repeat_bwb2003g lca_contract_value cft_sector2-cft_sector11 year9-year18 if divwb2003g>=0, out(w_repeat) common logit noreplacement
psmatch2 ba_wb2003g_25 anb_fsuppl_bwb2003g c_fsuppl_bwb2003g lca_contract_value cft_sector2-cft_sector11 year9-year18 if divwb2003g>=0, out(fsuppl) common logit noreplacement
psmatch2 ba_wb2003g_25 anb_corr_signp2_bwb2003g c_corr_signp2_bwb2003g lca_contract_value cft_sector2-cft_sector11 year9-year18 if divwb2003g>=0, out(corr_signp2) common logit noreplacement


***Table 4

psmatch2 ba_wb2003g_25 anb_sb_bwb2003g c_sb_bwb2003g lca_contract_value cft_sector2-cft_sector11 year9-year18 if divwb2003g>=0 & ca_procedure==0, out(singleb) common logit noreplacement
psmatch2 ba_wb2003g_25 anb_ca_bids_bwb2003g c_ca_bids_bwb2003g lca_contract_value cft_sector2-cft_sector11 year9-year18 if divwb2003g>=0 & ca_procedure==0, out(ca_bids) common logit noreplacement
psmatch2 ba_wb2003g_25 anb_corr_signp2_bwb2003g c_corr_signp2_bwb2003g lca_contract_value cft_sector2-cft_sector11 year9-year18 if divwb2003g>=0 & ca_procedure==0, out(corr_signp2) common logit noreplacement
psmatch2 ba_wb2003g_25 anb_w_repeat_bwb2003g c_w_repeat_bwb2003g lca_contract_value cft_sector2-cft_sector11 year9-year18 if divwb2003g>=0 & ca_procedure==0, out(w_repeat) common logit noreplacement
psmatch2 ba_wb2003g_25 anb_fsuppl_bwb2003g c_fsuppl_bwb2003g lca_contract_value cft_sector2-cft_sector11 year9-year18 if divwb2003g>=0 & ca_procedure==0, out(fsuppl) common logit noreplacement


***Table 5

psmatch2 ba_wb2003g_25 anb_sb_bwb2003g c_sb_bwb2003g lca_contract_value cft_sector2-cft_sector11 year9-year18 if divwb2003g>=0 & ca_procedure!=0, out(singleb) common logit noreplacement
psmatch2 ba_wb2003g_25 anb_ca_bids_bwb2003g c_ca_bids_bwb2003g lca_contract_value cft_sector2-cft_sector11 year9-year18 if divwb2003g>=0 & ca_procedure!=0, out(ca_bids) common logit noreplacement
psmatch2 ba_wb2003g_25 anb_corr_signp2_bwb2003g c_corr_signp2_bwb2003g lca_contract_value cft_sector2-cft_sector11 year9-year18 if divwb2003g>=0 & ca_procedure!=0, out(corr_signp2) common logit noreplacement
psmatch2 ba_wb2003g_25 anb_w_repeat_bwb2003g c_w_repeat_bwb2003g lca_contract_value cft_sector2-cft_sector11 year9-year18 if divwb2003g>=0 & ca_procedure!=0, out(w_repeat) common logit noreplacement
psmatch2 ba_wb2003g_25 anb_fsuppl_bwb2003g c_fsuppl_bwb2003g lca_contract_value cft_sector2-cft_sector11 year9-year18 if divwb2003g>=0 & ca_procedure!=0, out(fsuppl) common logit noreplacement



***APPENDIX C***


***Table 6

global outc corr_proc32 singleb ca_bids w_repeat fsuppl corr_signp2

foreach var of global outc {
	sum `var' if divwb2003g>=0 & divwb2003g!=. & ba_wb2003g_25!=.
	ttest `var' if divwb2003g>=0 & divwb2003g!=. & ba_wb2003g_25!=., by(ba_wb2003g_25)		
}


***Table 7

sum corr_proc32 singleb ca_bids w_repeat fsuppl corr_signp2 if divwb2003g>=0 & divwb2003g!=. & ba_wb2003g_25!=.


***Table 8

sum lca_contract_value anb_corr_proc32_bwb2003g c_corr_proc32_bwb2003g anb_sb_bwb2003g c_sb_bwb2003g anb_ca_bids_bwb2003g c_ca_bids_bwb2003g ///
anb_w_repeat_bwb2003g c_w_repeat_bwb2003g anb_fsuppl_bwb2003g c_fsuppl_bwb2003g anb_corr_signp2_bwb2003g c_corr_signp2_bwb2003g if divwb2003g>=0 & divwb2003g!=. & ba_wb2003g_25!=.


***Table 9

tab cft_sector if divwb2003g>=0 & divwb2003g!=. & ba_wb2003g_25!=.


***Table 10

tab country if divwb2003g>=0 & divwb2003g!=. & ba_wb2003g_25!=.



***Appendix D***


***Figure 4

psmatch2 ba_wb2003g_25 anb_sb_bwb2003g c_sb_bwb2003g lca_contract_value cft_sector2-cft_sector11 year9-year18 if divwb2003g>=0, out(singleb) common logit noreplacement
psgraph


***Figure 5 & Table 11

psmatch2 ba_wb2003g_25 anb_sb_bwb2003g c_sb_bwb2003g lca_contract_value cft_sector2-cft_sector11 year9-year18 if divwb2003g>=0, out(singleb) common logit noreplacement
pstest anb_sb_bwb2003g c_sb_bwb2003g lca_contract_value cft_sector2-cft_sector11 year9-year18 if divwb2003g>=0, both graph

